home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / a-comlin.ads < prev    next >
Text File  |  1996-01-30  |  3KB  |  60 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                     A D A . C O M M A N D _ L I N E                      --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.8 $                              --
  10. --                                                                          --
  11. -- This specification is adapted from the Ada Reference Manual for use with --
  12. -- GNAT.  In accordance with the copyright of that document, you can freely --
  13. -- copy and modify this specification,  provided that if you redistribute a --
  14. -- modified version,  any changes that you have made are clearly indicated. --
  15. --                                                                          --
  16. ------------------------------------------------------------------------------
  17.  
  18. package Ada.Command_Line is
  19. pragma Preelaborate (Command_Line);
  20.  
  21.    function Argument_Count return Natural;
  22.    --  If the external execution environment supports passing arguments to a
  23.    --  program, then Argument_Count returns the number of arguments passed to
  24.    --  the program invoking the function. Otherwise it return 0.
  25.    --
  26.    --  In GNAT: Corresponds to (argc - 1) in C.
  27.  
  28.    function Argument (Number : in Positive) return String;
  29.    --  If the external execution environment supports passing arguments to
  30.    --  a program, then Argument returns an implementation-defined value
  31.    --  corresponding to the argument at relative position Number. If Number
  32.    --  is outside the range 1 .. Argument_Count, then Constraint_Error is
  33.    --  propagated.
  34.    --
  35.    --  in GNAT: Corresponds to argv [n] (for n > 0) in C.
  36.  
  37.    function Command_Name return String;
  38.    --  If the external execution environment supports passing arguments to
  39.    --  a program, then Command_Name returns an implementation-defined value
  40.    --  corresponding to the name of the command invoking the program.
  41.    --  Otherwise Command_Name returns the null string.
  42.    --
  43.    --  in GNAT: Corresponds to argv [0] in C.
  44.  
  45.    type Exit_Status is new Integer;
  46.  
  47.    Success : constant Exit_Status;
  48.    Failure : constant Exit_Status;
  49.  
  50.    procedure Set_Exit_Status (Code : in Exit_Status);
  51.    pragma Import (C, Set_Exit_Status, "set_gnat_exit_status");
  52.  
  53. private
  54.  
  55.    Success : constant Exit_Status := 0;
  56.    Failure : constant Exit_Status := 1;
  57.    --  ??? Later these will be properly handled through Import variables.
  58.  
  59. end Ada.Command_Line;
  60.